package com.emellend.api.autocomplete;
import com.emellend.api.R;
import com.emellend.api.autocomplete.AutoComplete4.ContactListAdapter;
import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.widget.AutoCompleteTextView;
/**
 * 和4类似
 * @author emellend
 *
 */
public class AutoComplete5 extends Activity {
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.autocomplete_5);
		init();
	}

	private void init() {
		AutoCompleteTextView actv = (AutoCompleteTextView) findViewById(R.id.edit);
		ContentResolver resolver = this.getContentResolver();
		
		Cursor cursor = resolver.query(ContactsContract.Contacts.CONTENT_URI, 
				AutoComplete4.PEOPLE_PROJECTION, null, null, null);
		ContactListAdapter adapter = new AutoComplete4.ContactListAdapter(AutoComplete5.this, cursor);
		actv.setAdapter(adapter);
	}
	
}
